var navigationRule = {};

function init() {
	_initHeader();
	
	var array = new Array();
	
	array.push("portrait screen");
	array.push("reversePortrait screen");
	array.push("landscape screen");
	array.push("reverseLandscape screen");
	array.push("portrait|reversePortrait screen");
	array.push("landscape|reverseLandscape screen");
	array.push("portrait|reversePortrait|landscape|reverseLandscape screen");
	
	draw_list(array);
}

function setOnListClickHandler(idx) {
	switch(idx) {
		case 0 :
			testPortraitScreen();
		break;
		
		case 1 :
			testReversePortraitScreen();
		break;
		
		case 2 :
			testLandscapeScreen();
		break;
		
		case 3 :
			testReverseLandscapeScreen();
		break;
		
		case 4 :
			testPortraitReversePortrait();
		break;
		
		case 5 :
			testLandscapeReverseLandscapeScreen();
		break;
		
		case 6 :
			testPortraitLandscapeScreen();
			break;
			
		case 7 :
			testAllOrientation();
		break;
		
		default :
		break;
	}
}

function testPortraitScreen() {
	navigationRule.pageId = "screenOrientationResult_portrait";
	navigationRule.parameters = {
		"orientation" : "portrait"
	};
	
	navigation.navigate(navigationRule);
}

function testReversePortraitScreen() {
	navigationRule.pageId = "screenOrientationResult_reversePortrait";
	navigationRule.parameters = {
		"orientation" : "reversePortrait"
	};
	
	navigation.navigate(navigationRule);
}

function testLandscapeScreen() {
	navigationRule.pageId = "screenOrientationResult_landscape";
	navigationRule.parameters = {
		"orientation" : "landscape"
	};
	
	navigation.navigate(navigationRule);
}

function testReverseLandscapeScreen() {
	navigationRule.pageId = "screenOrientationResult_reverseLandscape";
	navigationRule.parameters = {
		"orientation" : "reverseLandscape"
	};
	
	navigation.navigate(navigationRule);
}

function testPortraitReversePortrait() {
	navigationRule.pageId = "screenOrientationResult_portrait|reversePortrait";
	navigationRule.parameters = {
		"orientation" : "portrait|reversePortrait"
	};
	
	navigation.navigate(navigationRule);
}

function testLandscapeReverseLandscapeScreen() {
	navigationRule.pageId = "screenOrientationResult_landscape|reverseLandscape";
	navigationRule.parameters = {
		"orientation" : "landscape|reverseLandscape"
	};
	
	navigation.navigate(navigationRule);
}

function testPortraitLandscapeScreen() {
	navigationRule.pageId = "screenOrientationResult_portrait|landscape";
	navigationRule.parameters = {
			"orientation" : "portrait|landscape"
	};
	
	navigation.navigate(navigationRule);
}

function testAllOrientation() {
	navigationRule.pageId = "screenOrientationResult_portrait|reversePortrait|landscape|reverseLandscape";
	navigationRule.parameters = {
		"orientation" : "portrait|reversePortrait|landscape|reverseLandscape"
	};
	
	navigation.navigate(navigationRule);
}